s = "asdf234GDdsf23"
result = sorted(s,key=lambda x:(x.isupper() or x.isdigit(), \
        x.isdigit(), x.isdigit() and int(x)%2==0))
print(result)
